package cz.muni.fi.pb138.xml.wrda.dao;

import cz.muni.fi.pb138.xml.wrda.core.XSD;
import java.util.List;

/**
 *
 * @author Ondřej Chrastina 430596@mail.muni.cz
 */
public interface XSDDao {
    
    /**
     * Saves XSD to database
     * 
     * @param data XSD object
     */
    void save(XSD data); 

    /**
     * delete XSD from database
     * 
     * @param data XSD object
     */
    void delete(XSD data); 

    /**
     * Return all XSD's from database
     * 
     * @return list of entries
     */
    List<XSD> getAllEntries();

    /**
     * Print all content of database
     * 
     * @return content of database
     */
    public String printAll();

    /**
     * Return all XSD's with distinct names - only one version of each other
     * 
     * @return list of XSD's
     */
    public Object getAllEntriesDistinctNames();

    /**
     * Return all XSD's by given name
     * 
     * @param fileName name of XSD
     * @return XSD object
     */
    public Object getAllEntriesByFileName(String fileName);

    /**
     * Return all XSD's by given timeStamp
     * 
     * @param name name of XSD
     * @param timeStamp time stamp of XSD
     * @return
     */
    public Object getEntryByFileNameAndTimeStamp(String name, String timeStamp);

    /**
     * Deletes all version of XSD
     * 
     * @param fileName name of XSD
     */
    public void deleteAllVersionsXsdEntryByName(String fileName);

    /**
     * Delete version by given timestamp
     * 
     * @param timeStamp time stamp of XSD
     */
    public void deleteXsdEntryTimeStamp(String timeStamp);

    /**
     * Get XSD entry by given time stamp
     * 
     * @param timeStamp time stamp of XSD
     * @return XSD
     */
    public XSD getEntryByTimestamp(String timeStamp);

    /**
     * Same as @see getAllEntriesDistinctNames with file name filter
     * 
     * @param fileNameInput fale name
     * @return Entries with given name
     */
    public Object getAllEntriesDistinctNamesByFileName(String fileNameInput);

    /**
     * Same as @see getAllEntriesDistinctNames with simple type filter
     * 
     * @param typeNameInput simple type name
     * @return Entries with given simple type
     */
    public Object getAllEntriesDistinctNamesBySimpleTypeContains(String typeNameInput);

    /**
     * Same as @see getAllEntriesDistinctNames with complex type filter
     * 
     * @param typeNameInput complex type name
     * @return Entries with given complex type
     */
    public Object getAllEntriesDistinctNamesByComplexTypeContains(String typeNameInput);

    /**
     * Same as @see getAllEntriesDistinctNames with simple type filter and name filter
     * 
     * @param fileNameInput file name
     * @param typeNameInput simple type name
     * @return Entries with given simple type and name
     */
    public Object getAllEntriesDistinctNamesByFileNameAndSimpleType(String fileNameInput, String typeNameInput);

    /**
     * Same as @see getAllEntriesDistinctNames with complex type filter and name filter
     * 
     * @param fileNameInput file name
     * @param typeNameInput complex type name
     * @return Entries with given complex type and name
     */
    public Object getAllEntriesDistinctNamesByFileNameAndComplexType(String fileNameInput, String typeNameInput);

    /**
     * Same as @see getAllEntries() with simple type filter and name filter
     * 
     * @param fileName file name
     * @param typeNameInput simple type name
     * @return Entries with given simple type and name
     */
    public Object getAllEntriesByFileNameAndSimpleTypeContains(String fileName, String typeNameInput);

    /**
     * Same as @see getAllEntries() with xomplex type filter and name filter
     * 
     * @param fileName file name
     * @param typeNameInput simple type name
     * @return Entries with given complex type and name
     */
    public Object getAllEntriesByFileNameAndComplexTypeContains(String fileName, String typeNameInput);
    
}
